package com.haoran.grope.client;

import org.springframework.amqp.core.TopicExchange;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RabbitMQClient {

	@Autowired
	private RabbitTemplate rabbitTemplate;

	@Autowired
	private TopicExchange exchange;

	public void send(String message, String routerKey) {
		rabbitTemplate.convertAndSend(exchange.getName(), routerKey, message);
	}
}
